package com.xnfh.home.viewmodel

import com.xnfh.framework.base.BaseRepository
import com.xnfh.framework.bean.CropTypeBean
import com.xnfh.framework.bean.FieldDynamicsBean
import com.xnfh.framework.bean.PlanScheme
import com.xnfh.framework.bean.RespStateData
import com.xnfh.network.manager.ApiManager

/**
 * @Description:
 * @Author: ziheng
 * @CreateDate: 2024/1/5 13:48
 * @UpdateUser: ziheng
 * @UpdateDate: 2024/1/5 13:48
 * @UpdateRemark: 更新说明
 */
class ClubDetailViewModelRes : BaseRepository() {
    suspend fun requestPlantingScheme(
        cropIds: String,
        planName: String,
        pageNum: Int,
        data: RespStateData<PlanScheme>
    ) = dealResp(
        { ApiManager.api.requestPlanCropList(cropIds, planName, pageNum) }, data
    )
    suspend fun requestFieldMessage(
        cropId: Int?,
        provinceId: String?,
        cityId: String?,
        feedbackType: String?,
        page: Int,
        data: RespStateData<FieldDynamicsBean>
    ) = dealResp(
        {ApiManager.api.requestFieldMessage(cropId,provinceId,cityId,feedbackType,page)},data
    )
    suspend fun requestCropType(data: RespStateData<List<CropTypeBean>>) = dealResp(
        {ApiManager.api.requestCropType()},data
    )
}